import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../views/Login'
import Layout from '../Layout'
import Register from '../views/register'



Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'login',
    component: Login
  },
  {
    path: '/register',
    name: 'register',
    component:Register
  },
 
  {
    path: '/Layout',
    component:Layout,
    redirect: '/index',
    children:[
      {
        path: '/index',
        component:()=>import('../views/index')
      },
    ]
    // children:[
    //   {
    //     path:'/product/list',
    //     name:'home',
    //     component:()=>import('../views/home')
    //   },
    //   {
    //     path:'/product/addlist',
    //     name:'addlist',
    //     component:()=>import('../views/Addlidt')
    //   }
    // ]
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
